#include "Card.h"
int Card::CID = 0;
Card::Card(int ct,string date):Count(ct),Date(date)
{
    op = new Operate;
    if(CID == 0)
    {
        CID = op->getMax("CID", "card");
        if(CID < 0)
            CID = 0;
    }
    CID++;
}
Card::~Card(){}

int Card::getCID()
{
    return CID;
}
void Card::setCID(const int& cid)
{
    this->CID=cid;
}
string Card::getDate()
{
    return Date;
}
void Card::setDate(const string& date)
{
    this->Date=date;
}
int Card::getCount()
{
    return Count;
}
void Card::setCount(const int& ct)
{
    this->Count=ct;
}
void Card::sub()
{
    string sql("");
    sql+="insert into Card(CID,Date,Count) value(\'";
    sql+=CID+'0';
    sql+="\', \'";
    sql+=Count+'0';
    sql+="\', \'";
    sql+=Date;
    sql+="\', \'";
    op->Insert(sql);
}
